// 快捷方式
<template>
  <el-tabs class="app-breadcrumb" v-model="activeName" @tab-click="toRouter">
    <el-tab-pane :name="v.name" :label="v.label" v-for="(v,k) in list" :key='k'></el-tab-pane>
  </el-tabs>
</template>

<script>

  export default {
    data() {
      return {
        activeName: null,
        list: [],
      }
    },
    watch: {
      $route(route) {
        this.activeName = route.path
      },
    },
    created() {
      this.activeName = this.$route.path
      this.getList()
    },
    methods: {
      getList() {
        this.list = [{
          name: '/admin/index',
          label: '账户管理'
        }, {
          name: '/user/index',
          label: '用户管理'
        }]
      },
      toRouter(e) {
        this.$router.push(e.name);
      },

      isActive(route) {
        return route.path === this.$route.path
      },
    },
  }

</script>

<style lang="scss" scoped>
  .app-breadcrumb.el-tabs {
    margin-left: 10px;
    width: calc(100% - 200px);
  }

</style>
